﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Ext.Net;

namespace BitPortal.Admin.Media.Media.Module
{
    public partial class SearchYoutubeVideo : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                XmlDataSource1.DataFile = "http://gdata.youtube.com/feeds/api/videos";
                Store1.DataBind();
            }
        }
        protected void btnInsert_Click(object sender, DirectEventArgs e)
        {
            XmlDataSource1.DataFile = "http://gdata.youtube.com/feeds/api/videos?v=2&q=" + Server.UrlEncode(txtKeyword.Text) +
                "&orderby=" + cbSortOrder.SelectedItem.Value + "&max-results=" + txtMaxResult.Text + "&alt=rss";
            Store1.DataBind();
        }
    }
}